home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Development Tools & Languages / DTSCPlusLibrary / Sources / Menu.cp < prev    next >
Encoding:
Text File  |  1993-01-14  |  1.5 KB  |  56 lines  |  [TEXT/MPS ]

  1. /* _________________________________________________________________________________________________________ //
  2.   Copyright © 1992-93 Apple Computer, Inc. All rights reserved.
  3.   Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
  4.   Programmer: Kent Sandvik
  5.   Date: 12/21/92
  6.   Revision comments are at the end of this file.
  7.   ---
  8.   TMenubar is a simple object that keeps track of the menubar     
  9.   TMenu.cp contains TMenubar member functions.
  10.   _________________________________________________________________________________________________________ */
  11.  
  12. // HEADER FILES
  13. #ifndef _MENU_
  14. #include "Menu.h"
  15. #endif
  16.  
  17.  
  18. //    CONSTRUCTORS AND DESTRUCTORS
  19. #pragma segment Menu
  20. TMenubar::TMenubar(short ResourceID)
  21. // Constructor, create a visible menu bar.
  22. {
  23.     Handle aMenubar = NULL;
  24.  
  25.     // Load the MBAR resource defined in the ID.
  26.     aMenubar = ::GetNewMBar(ResourceID);
  27.     ASSERT(aMenubar != NULL, "\pProblems loading in MBAR");
  28.  
  29.     if(aMenubar != NULL)
  30.     {
  31.         ::SetMenuBar(aMenubar);                        // install menus
  32.         ::DisposHandle(aMenubar);                    // don't need it any longer    
  33.     
  34.         ::AddResMenu(::GetMHandle(mApple), 'DRVR');    // add DA names to Apple menu
  35.     
  36.         ::DrawMenuBar();                            // install the menu bar itself
  37.     }
  38. }
  39.  
  40.  
  41. #pragma segment Menu
  42. TMenubar::~TMenubar()
  43. // Default destructor -- empty for the time being.
  44. {
  45. }
  46.  
  47.  
  48. // _________________________________________________________________________________________________________ //
  49.  
  50.  
  51. /*    Change History (most recent last):
  52.   No        Init.    Date        Comment
  53.   1            khs        12/21/92    New file
  54.   2            khs        1/7/93        Cleanup
  55. */
  56.